package com.albaba.designpattern.chain_of_responsibility.text_002;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zx
 * @version 1.0
 * @description 模拟审核服务
 * @date 2025/2/24 21:36
 */
public class AuthService {
    // 审核信息容器
    // key:审批人id + 审批单Id
    // value:审批时间
    private static Map<String, Date> authMap = new HashMap<>();

    /**
     * 审批方法
     *
     * @param uId     审核人id
     * @param orderId 审核单id
     */
    public static void auth(String uId, String orderId) {
        System.out.println("进入审批流程,审核人ID：" + uId + ",审批单：" + orderId);

        authMap.put(uId.concat(orderId), new Date());
    }

    public static Date queryAuthInfo(String uId, String orderId) {
        return authMap.get(uId.concat(orderId));
    }

}
